package com.petRescueCenter.demo.voluntary.entity;

import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.petRescueCenter.demo.common.enumPackage.LockedEmun;
import com.petRescueCenter.demo.common.enumPackage.SexEmun;
import com.petRescueCenter.demo.common.enumPackage.StateEmun;

@Entity
@Table(name = "t_volunteer")

public class Volunteer {

	private Long id;
	private Long userId;
	private SexEmun sex;
	private String name;
	private String why;
	// 申请时间
	private Date createTime;
	private String idCard;
	private StateEmun state;
	private String tel;
	private LockedEmun locked;
	private String mail;
	private String address;
	private Set<UserVoluntary> uservoluntary;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}

	public SexEmun getSex() {
		return sex;
	}

	public void setSex(SexEmun sex) {
		this.sex = sex;
	}

	@OneToMany(mappedBy = "volunteer", cascade = CascadeType.ALL)
	public Set<UserVoluntary> getUservoluntary() {
		return uservoluntary;
	}

	public void setUservoluntary(Set<UserVoluntary> uservoluntary) {
		this.uservoluntary = uservoluntary;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getUserId() {
		return userId;
	}

	public String getName() {
		return name;
	}

	public String getWhy() {
		return why;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss", timezone = "GMT+8")
	public Date getCreateTime() {
		return createTime;
	}

	public String getIdCard() {
		return idCard;
	}

	public StateEmun getState() {
		return state;
	}

	public LockedEmun getLocked() {
		return locked;
	}

	public String getMail() {
		return mail;
	}

	public void setLocked(LockedEmun locked) {
		this.locked = locked;
	}

	public void setMail(String mail) {
		this.mail = mail;
	}

	public String getTel() {
		return tel;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setWhy(String why) {
		this.why = why;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public void setIdCard(String idCard) {
		this.idCard = idCard;
	}

	public void setState(StateEmun state) {
		this.state = state;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

}
